package com.spring.bean.demo7;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component("bean1")
public class Bean1 {
    @PostConstruct
    public void init () {
        System.out.println("初始化 Bean");
    }

    public void say () {
        System.out.println("say...");
    }

    @PreDestroy
    public void destroy () {
        System.out.println("销毁 Bean");
    }
}
